@extends('home.layout.index')
@section('link')
<link rel="stylesheet" href="/homeassets/homepage/meizu/css/layout-25702f0ee1.css" />
<link rel="stylesheet" href="/homeassets/homepage/meizu/css/list-30ce4a4a2d.css" />
@endsection
@section('content')
<div class="container">
<!-- 筛选 -->
	<section class="filter clearfix" id="filter" style="display: block;">
	    <div class="filter-order" id="J_filterOrder">
	        <a  class="@if(empty($request['active'])) active @endif @if(!empty($request['active']) && $request['active'] == 'evaulate') active @endif" href="/main/search?active=evaulate&keyword={{ $request['keyword'] }}">
	            推荐
	        </a>
	        <a data-tag="1" class="@if(!empty($request['active']) && $request['active'] == 'ctime') active @endif"  href="/main/search?active=ctime&keyword={{ $request['keyword'] }}">
	            新品
	        </a>
	        <a data-tag="2"  class="@if(!empty($request['active']) && $request['active'] == 'price') active @endif"  href="/main/search?active=price&keyword={{ $request['keyword'] }}">
	            价格<i class="icon-arrow-down" ></i>
	        </a>
	    </div>
	</section>

	<!-- 商品展示 -->
		<section class="goods-list" id="goodsList" style="display: block;">
			<ul class="goods-list-wrap clearfix" id="goods
			ListWrap" style="margin:0;padding:0">
				@foreach($goods as $value)
				<li class="gl-item" >
				    <dl class="gl-item-wrap">
				        <dd class="mod-pic">
				            <a data-mtype="" target="_blank" href="/goodsdetail/{{ $value['id'] }}" title="{{ $value['goodsname'] }}">
				                <img width="220" height="220" src="{{ $value['picture'] }}" onerror="this.src='/homeassets/homepage/images/lazyload-8b704ceeec.gif'">
				            </a>
				        </dd>
				        <dd class="mod-name" style="margin:0">
				            <a data-mtype="name" target="_blank" href="/goodsdetail/{{ $value['id'] }}">
				            	{{ $value['goodsname'] }}
				            </a>
				        </dd>
				        <dd class="mod-price">
				            
				            <span>￥</span>
				            <span class="vm-price">{{ $value['price'] }}</span>
				            
				        </dd>
				    </dl>
				</li>
				@endforeach
			</ul>
			</section>
			<!-- 引入分页用的样式 -->
			 <link href="/adminassets/assets/css/bootstrap.css" rel="stylesheet" />
			<div class="row">
				<div class="col-sm-5"></div>
				<div class="col-sm-6"><div class="dataTables_paginate paging_simple_numbers" id="dataTables-example_paginate">
                                	{!! $goods -> appends($request) -> render() !!}
                                </div>
                            </div>
                           </div>
</div>
<input type="hidden" id="replace" value="{{ $request['keyword'] }}" />	
@endsection
@section('js')
<script>
	var re = $('#replace').val();
	$('a[data-mtype=name]').each(function(){
		$(this).html($(this).html().replace(re,'<b style="color:red">'+$('#replace').val()+'</b>'))
	})
</script>
@endsection
